<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">
        <!-- <div class="box">
            <span>hello world!</span>
        </div> -->
    </div>
    <script src="https://unpkg.com/react@16/umd/react.development.js" crossorigin></script>
    <script src="https://unpkg.com/react-dom@16/umd/react-dom.development.js" crossorigin></script>
    <script>

        let box = document.querySelector('.box');

        // console.dir(box);
        //虚拟dom:描述真实dom的js对象
        /**
            {
                tag: "div",
                props: {
                    class: "box"
                },
                children: [{
                    tag: "span",
                    props: {},
                    children: ["hello world!"]
                }]
            }
        */

        let oSpan = React.createElement('span',{},'hello world');

        let oDiv = React.createElement('div',{className:'box'},oSpan);

        console.log(oDiv)

        ReactDOM.render(oDiv,document.querySelector('#app'));
    </script>
</body>
</html>